<?php
namespace szxh\model;
/**
 * 
 */
class AppHome extends Common {
    
    public function __construct() {
        parent::__construct();
        $this->setTableName('actionsort');
    }
    public function getAllDate() {
        $list = $this->query
                     ->from($this->tableName)
                     ->orderby('uid', 'DESC')
                     ->getall();
        
        if($list === false) {
            return $this->setInfo(100,'获取购买记录异常');
        }
        return $list;
        //var_dump($list);
    }

    public function getRow() {
        $row = $this->query->from($this->tableName)->count();
        // $row = pdo_fetch("select count(*) from ".$this->tableName);
    
        if($row === false) {
            return $this->setInfo(100,'数据异常');
        }
        return $row;
    }

    public function getDate() {
        $date = $this->query
                     ->from(getTableName('actionchange'))
                     ->orderby('id','DESC')
                     ->getall();
        if($date === false) {
            return $this->setInfo(100,'活动详细介绍数据异常');
        }
        return $date;
    }
    public function getNum() {
        $num = $this->query
                    ->from(getTableName('apptable'))
                    ->select('pageview')
                    ->get();
        //var_dump($num);
        return $num;
    }

    public function upNume($up) {
        $arr = array('pageview'=>$up);
        pdo_update(getTableName('apptable'),$arr,array('id' => 1));
    }
}
?>